'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  router.get('/', controller.home.index);
  router.resources('/administrators','/api/administrators',app.middleware.checkToken(),controller.administrators);
  router.resources('/realtimeInfo','/api/realtimeInfo',controller.realtimeInfo);
  router.resources('/aboutUs','/api/aboutUs',controller.aboutUs);
  router.resources('/setUp','/api/setUp',controller.setUp);
  router.resources('/mail','/api/mail',controller.mail);
  router.resources('/superAdministrator','/api/superAdministrator',controller.superAdministrator);
  router.resources('/rotationChart','/api/rotationChart',controller.rotationChart);
  router.resources('/agreement','/api/agreement',controller.agreement);
  router.resources('/network','/api/network',controller.network);
  router.resources('/picture','/api/picture',controller.picture);
  router.post('/api/picture',controller.picture.uploadImg);
  // router.get('/api/picture',controller.picture.show);

  // router.post('/api/rotationChart',controller.rotationChart.uploadImg);
  router.post('/api/token',controller.token.index);
};
